package com.shao.im.controller;


import com.shao.commons.domain.R;
import com.shao.im.entity.Comment;
import com.shao.im.service.CommentService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * 评论表(Comment)表控制层
 *
 * @author makejava
 * @since 2023-08-04 22:23:23
 */
@RestController
@RequestMapping("/comment")
@Slf4j
public class CommentController {
    /**
     * 服务对象
     */
    @Autowired
    private CommentService commentService;

    /**
     * 添加动态评论
     * @param comment
     * @return
     */
    @RequestMapping("/addComment")
    public R addPostComment(Comment comment) {
        log.debug("[comment] 添加动态评论 - {}", comment);
        commentService.save(comment);
        return R.success();
    }
}

